import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.less'

class Login extends React.Component {
	
	state = {
		username: '',
		password: '',
	}
	
	death = (e) => {
		e.preventDefault()
		ReactDOM.unmountComponentAtNode()
	}
	
	// 组件挂载完毕
	componentDidMount() {
		console.log('组件挂载完毕')
	}
	
	// 组件将要卸载
	componentWillUnmount() {
		console.log('组件将要卸载')
	}
	
	// 初始化渲染，状态更新之后
	render() {
		// 读取状态
		// let { isHot } = this.state
		return (
			<div>
				<h1>你好</h1>
				<button onClick={this.death}>移除</button>
			</div>
		)
	}
	
}

export default Login
